function [ r, theta, v ] = equalspacepolar( N, sigma )
% takes number of traps n and total trap length sigma and computes
% the asymptotic mean passage time v in polar coordinates

D = 1;

numtheta = 1000;
numr = 100;

epsilon = 2*pi*sigma/N;


theta0 = 0:2*pi/N:2*pi-2*pi/N;
r = 0:1/numr:1;
theta = 0:2*pi/numtheta:2*pi;

v = zeros(length(r),length(theta));
G = zeros(length(r),length(theta));

for i = 1:length(r)
    for j = 1:length(theta)
        for k = 1:N
            G(i,j) = G(i,j) - 1/pi * log(sqrt(1+r(i)^2-2*r(i)*cos(theta(j)-theta0(k)))) + r(i)^2/(4*pi) - 1/(8*pi);
        end
        v(i,j) = 1 / (D*N) * (-log(epsilon*N/2) + N/8 - pi*G(i,j));
        if v(i,j) < 0
            v(i,j) = 0;
        end
    end
end



end

